﻿<%@ Page Title="" Language="C#" MasterPageFile="~/backend/Admin.Master" AutoEventWireup="true" CodeBehind="AlbumEdit.aspx.cs" Inherits="mamnontuoitho7.backend.AlbumEdit"  ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminTitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript" type="text/javascript">
    function Validation() {
        var title = trim(document.getElementById("<%= txtTitleName.ClientID %>").value);
        var des = trim(document.getElementById("<%= txtDescription.ClientID %>").value);

        var leng = title.length;
        if (leng == 0 || leng > 500) {
            alert("Tên album dài hơn 1 ký tự và không quá 500 ký tự");
            return false;
        }

        if (des.length == 0 || des.length > 1500) {
            alert("Mô tả bài viết không được để trống và không quá 1500 ký tự");
            return false;
        }
    }
    function trim(str) {
        return str.replace(/^\s+|\s+$/g, "");
    }
</script>
<form id="form1" runat="server">
    <!-- Begin one column tab content window -->
    <div class="onecolumn">
	    <div class="header">
		    <span>Chỉnh Sửa Album Ảnh</span>
		    <div class="switchbutton">
                  <a href="AlbumList.aspx" class="buttons stylebutton">Danh sách Album</a>
		    </div>
	    </div>
	    <br class="clear"/>
	    <div class="content">
            <div class="avatarimg"><asp:Image ID="imgAlbum" runat="server" CssClass = "img259x155" />
            </div>
		    <div id="tab2_content" class="tab_content">
                <div class="tableform">
                    <div>
                        <div class="left">
                            Tên album ảnh:<br />
                            <asp:TextBox ID="txtTitleName" runat="server" style="width:340px;"></asp:TextBox>
                            <asp:HiddenField ID = "hid_Description" runat="server" />
                            <asp:HiddenField ID = "hid_TitleName" runat="server" />
                            <asp:HiddenField ID = "hid_AlbumID" runat="server" />
                        </div>
                        <div class="right">
                            Hình ảnh chủ đề:<br />
                            <asp:FileUpload ID="fulPhoto" runat="server" style="width:346px;"/>
                        </div>
                    </div><br class="clear"/><br />
                    <div>
                        Mô tả bài viêt:<br />
                        <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server" style="width:750px; min-height:100px;"></asp:TextBox></div><br />
                    <p>
				        <asp:Button ID="btnAlbumEdit" runat="server" Text="Lưu" 
                            onclick="btnAlbumEdit_Click" OnClientClick="return Validation()"/>
                             <asp:Button ID="btnRefresh" runat="server" Text="Làm lại" 
                            onclick="btnAlbumRefresh_Click" />
                        </p>
                </div><br class="clear"/>
		    </div>
	    </div>
    </div>
    <!-- End one column tab content window -->
</form>
</asp:Content>
